package com.buddies.lottery.data.api;

import com.buddies.lottery.data.bean.Lottery;
import com.buddies.lottery.data.bean.LotteryBetRecord;
import com.buddies.lottery.data.bean.LotteryCategory;
import com.buddies.lottery.data.bean.LotteryReward;
import com.buddies.lottery.data.resp.HomeResponse;
import com.buddies.lottery.data.resp.LotteryConfigResponse;
import com.buddies.lottery.data.resp.LotteryDetailResponse;
import com.buddies.lottery.data.resp.LotteryTabOptionsResponse;
import com.buddies.lottery.data.resp.LotteryTrendResponse;
import com.buddies.lottery.data.resp.PostBetResponse;
import com.buddies.lottery.data.result.ApiResult;
import com.buddies.lottery.data.result.PageResult;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Description:
 * Date: 2018/2/24
 * Author: xuliang
 */
public interface LotteryApi {

    /* 获取彩种列表 */
    @GET("lottery/home")
    Observable<ApiResult<HomeResponse>> getHome();

    /* 获取详情 */
    @GET("lottery/detail")
    Observable<ApiResult<LotteryDetailResponse>> getLotteryDetail(@Query("id") int lotteryId);

    /* 获取开奖历史列表 */
    @GET("lottery/history")
    Observable<ApiResult<PageResult<LotteryReward>>> getLotteryHistory(@Query("id") int lotteryId, @Query("page") int page);

    /* 获取开奖趋势列表 */
    @GET("lottery/trend")
    Observable<ApiResult<LotteryTrendResponse>> getLotteryTrend(@Query("id") int lotteryId, @Query("page") int page);

    /* 获取彩种分类列表 */
    @GET("lottery/category/list")
    Observable<ApiResult<PageResult<LotteryCategory>>> getLotteryCategoryList();

    /* 获取彩种列表 */
    @GET("lottery/list")
    Observable<ApiResult<PageResult<Lottery>>> getLotteryList(@Query("id") int lotteryCategoryId);

    /* 获取彩种列表(简洁版) */
    @GET("lottery/list/simple")
    Observable<ApiResult<PageResult<Lottery>>> getSimpleLotteryList();

    /* 获取彩种玩法选项 */
    @GET("lottery/tab/options")
    Observable<ApiResult<LotteryTabOptionsResponse>> getLotteryTabOptions(@Query("id") String lotteryTabQueryId);

    /* 投注 */
    @FormUrlEncoded
    @POST("lottery/post")
    Observable<ApiResult<PostBetResponse>> postBet(@Field("id") int lotteryId, @Field("period") String period, @Field("bets") String betItems);

    /* 获取投注记录 */
    @GET("lottery/post/list")
    Observable<ApiResult<PageResult<LotteryBetRecord>>> getLotteryBetRecord(@Query("id") int lotteryId, @Query("period") String period, @Query("status") String status, @Query("page") int page);

    /* 获取投注记录详情 */
    @GET("lottery/post/detail")
    Observable<ApiResult<LotteryBetRecord>> getLotteryBetDetail(@Query("id") int betId);

    /* 获取彩票配置 */
    @GET("lottery/config")
    Observable<ApiResult<LotteryConfigResponse>> getLotteryConfig();
}
